//
//  SeviceCell.m
//  Shengzhuli
//
//  Created by subook on 2017/10/11.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "SeviceCell.h"

@implementation SeviceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createUI];
    }
    return self;
}
- (void)createUI {
    _serviceNameLabel = [[UILabel alloc] initWithFrame:(CGRectMake(20, 20, ScreenH-40, 20))];
    _serviceNameLabel.font = [UIFont systemFontOfSize:18];
    _serviceNameLabel.text = @"纯天然植物产品的研究，";
    [self.contentView addSubview:_serviceNameLabel];
    
    _servicePriceLabel = [[UILabel alloc] initWithFrame:(CGRectMake(20, 55, ScreenW/2, 20))];
    _serviceJionLabel.textAlignment = NSTextAlignmentLeft;
    _servicePriceLabel.textColor = [UIColor redColor];
    _servicePriceLabel.text = @"¥2000/次";
    _servicePriceLabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:_servicePriceLabel];
    
    _serviceJionLabel = [[UILabel alloc] initWithFrame:(CGRectMake(ScreenW/2-20, 55, ScreenW/2, 20))];
    _serviceJionLabel.textColor = [UIColor grayColor];
    _serviceJionLabel.textAlignment = NSTextAlignmentRight;
    //_serviceJionLabel.text = @"301个人拜访过";
    _serviceJionLabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:_serviceJionLabel];
}
- (void)updateCellWithModel:(KaProductModel *)model {
    self.serviceNameLabel.text = model.headings;
    self.servicePriceLabel.text = [@"¥" stringByAppendingString:model.money];
    self.serviceJionLabel.text = [model.quantity stringByAppendingString:@"人拜访过"];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
